package cn.ydxlm.vrlibrary;

import android.os.Bundle;

import cn.ydxlm.vrlibrary.vr.VRPlayerView;

import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;


/**
 * Created by wheat7 on 2017/7/18.
 */

public class VRPlayerActivity extends AppCompatActivity {


    VRPlayerView mPlayerView;

    @Override
    protected void onCreate (@Nullable Bundle savedInstanceState) {
//        requestWindowFeature(Window.FEATURE_NO_TITLE);
//        getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
//                WindowManager.LayoutParams.FLAG_FULLSCREEN);
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_vr_player);
        initView(savedInstanceState);
    }

    public void initView (Bundle savedInstanceState) {
        mPlayerView = findViewById(R.id.player);
        mPlayerView.setVideoPath(getIntent().getStringExtra("url"));
//        mPlayerView.setVideoPath("rtmp://5g8k.guojutech.net/DongFenShuiKu/VR");
//        mPlayerView.setMediaControllerTitle(findViewById(R.id.mediacontroller_title));
        findViewById(R.id.mediacontroller_title).setOnClickListener(v -> finish());
    }

    public void onBackClick () {
        this.finish();
    }


    @Override
    protected void onPause () {
        super.onPause();
        mPlayerView.onPause();

    }

    @Override
    protected void onDestroy () {
        super.onDestroy();
        mPlayerView.onDestroy();
    }

    @Override
    protected void onResume () {
        super.onResume();
        mPlayerView.onResume();
    }


}
